<!DOCTYPE html>
<include file="Public:header"/>
<script type="text/javascript">
    var UEURL = '__ROOT__/Public/Plugin/umeditor/';
</script>
<link href="__PUBLIC__/Plugin/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="__PUBLIC__/Plugin/umeditor/third-party/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Plugin/umeditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Plugin/umeditor/umeditor.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Plugin/layDate/laydate/laydate.js"></script>
<script type="text/javascript" src="__PUBLIC__/Plugin/umeditor/lang/zh-cn/zh-cn.js"></script>

<link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="__PUBLIC__/Theme1/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
<link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">
<link href="__PUBLIC__/Plugin/style/css/common.css" type="text/css" rel="stylesheet">
<link href="__PUBLIC__/Plugin/style/css/index.css" type="text/css" rel="stylesheet">

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测评管理</title>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>测评详情
                        <small></small>
                    </h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form method="post" action="__URL__/editGood"  class="form-horizontal"
                          enctype="multipart/form-data">
                        <input type="hidden" value="{$id}" name="id">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">测评标题</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="name" id="name" placeholder="请输入活动名称"
                                       value="{$result.titlt}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">客户名</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="name" id="name" placeholder="请输入活动名称"
                                       value="{$result.nickname}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">早教机构</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="zjname" id="zjname" placeholder="请输入早教机构"
                                       value="{$result.zjname}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">点赞数量</label>
                            <div class="col-sm-2">
                                <input type="number" class="form-control" name="num" id="num" placeholder="请输入任务数量"
                                       value="{$result.dz}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">转发数量</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="dz" id="dz" placeholder="请输入任务地址"
                                       value="{$result.zf}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">收藏数量</label>
                            <div class="col-sm-2">
                                <input type="number" class="form-control" name="jl" id="jl" placeholder="请输入奖励金币"
                                       value="{$result.sc}" required>
                            </div>
                        </div>
        

                        <div  class="form-group people">
                            <label class="col-sm-2 control-label">要搜索的群组</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="text" id="text" placeholder="请输入要搜索的群组"
                                 onkeyup="search_group()" >
                            </div>
                        </div>

                        <div class="form-group chose" style="display: none">
                        <label class="col-sm-2 control-label">选择参与活动的人</label>
                        <div class="col-sm-4 showuser" style="padding-top: 6px;">
                            <volist name="group" id="vo"><input name="group_id[]" type="checkbox" value="{$vo['id']}">{$vo['name']}&nbsp;</volist>
                        </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">测评内容</label>
                            <div class="col-sm-6">
                                <div type="text/plain" id="myEditor1" name="content"
                                     style="width:660px;height:240px;">
                                    {$result['con']}
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <!-- <button class="btn btn-primary" type="submit">保存</button> -->
                                <a class="btn btn-white" href="{:U('Admin/Good/activityList')}">返回</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="long" value="{$result['long']}">
<input type="hidden" id="now" value="{$result['now']}">

</body>
</html>
<script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/Plugin/style/js/imgUp.js"></script>
<script>

    //实例化编辑器
    var um1 = UM.getEditor('myEditor1');

    laydate.render({
        elem: '#start_time' //指定元素
    });
    laydate.render({
        elem: '#end_time' //指定元素
    });
    $(document).ready(function () {
        var long = $("#long").val();
        if (long == 1) {
            $(".form-group.time").hide();
        } else {
            $(".form-group.time").show();
        }


    });
    $('input:radio[name="long"]').change(function () {
        if ($(this).is(":checked")) {
            if ($(this).val() == 1) {
                $(".form-group.time").hide();
            } else {
                $(".form-group.time").show();
            }

        } else {
            alert(0);
        }
    });
    $(".form-group.people").hide();
    $('input:radio[name="all_people"]').change(function () {
        if ($(this).is(":checked")) {
            if ($(this).val() == 1) {
                $(".form-group.people").hide();
                $(".form-group.chose").hide();
            } else {
                $(".form-group.people").show();
                $(".form-group.chose").show();
            }

        } else {
            alert(0);
        }
    });
//输入搜索群组
    function search_group() {
        var search=$("#text").val();
        var html=''
        console.log(search);
        $.ajax({
            url:"__CONTROLLER__/searchGroup",
            data:{"search":search},
            dataType:"json",
            type:"post",
            success:function (res) {
                console.log(res.data);
                if(res.state==1){
                for (var i in res.data){
                    html+='<input name="group_id[]" type="checkbox"value="'+res.data[i]["id"]+'">'+res.data[i]['name'];

                }
                    $('.showuser').html('');
                $('.showuser').html(html)
            }else{
                    $('.showuser').html('');
                }
 }

        })
    }

    //删除轮播图片
    function delPic() {
        var a = $(".del_id").val();
        console.log(a);
    }
    function previewImage(file) {
        var prevDiv = document.getElementById('preview');
        if (file.files && file.files[0]) {
            var reader = new FileReader();
            reader.onload = function (evt) {
                prevDiv.innerHTML = '<img style="width: 200px;height: 200px" class="re" src="' + evt.target.result + '" />';
                $("#wxpic").next("input").remove();
                $("#wxpic").remove();
            }
            reader.readAsDataURL(file.files[0]);
        } else {
            prevDiv.innerHTML =
                '<div class="re" style="width: 200px;height: 200px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
            $("#wxpic").next("input").remove();
            $("#wxpic").remove();
        }
    }
    function uploadpic() {
        $("#wxpic").next("input").remove();
        $("#wxpic").remove();
        $(".re").attr("src", "");
        $(".re").attr("style", "display:none");
    };

</script>